package com.lsfb.duishangbaos.ShopManage;

import android.content.Context;
import android.view.View;

import com.lsfb.duishangbaos.R;
import com.lsfb.duishangbaos.Utils.URLString;
import com.zgscwjm.lsfbbasetemplate.Event.LsfbEvent;
import com.zgscwjm.lsfbbasetemplate.adapter.CommonAdapter;
import com.zgscwjm.lsfbbasetemplate.adapter.ViewHolder;

import java.util.List;

/**
 * Created by Administrator on 2017/5/11 0011.
 */

public class GetShopAdapter extends CommonAdapter<ShopImgBean> {
    public GetShopAdapter(Context context, int layoutId, List<ShopImgBean> list) {
        super(context, layoutId, list);
    }

    @Override
    public void convert(ViewHolder holder, final ShopImgBean model) {
        holder.setImg(R.id.item_img, URLString.IMAGES + model.getImg(), R.drawable.img_zhanwei);
        holder.setOnclick(R.id.item_img_del, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ShopImgDelEvent event=new ShopImgDelEvent();
                 event.setData(model.getImg());
                LsfbEvent.getInstantiation().post(event);
            }
        });
    }
}
